package com.example.butterknifedemo;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import butterknife.ButterKnife;

public abstract class BaseActivity extends AppCompatActivity {

    public abstract int getContentViewId();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(getContentViewId());
        ButterKnife.bind(this);
        initAllMemersView(savedInstanceState);
    }

    public abstract void initAllMemersView(Bundle savedInsatanceState);

    @Override
    protected void onDestroy() {
        super.onDestroy();
        // 7.0有unbind方法，用于解除绑定
        // ButterKnife.unbind(this);
    }
}
